import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import * as filters from './filters' // global filters
import '@/icons' // icon
import {
  Row,
  Col,
  // Row,
  // Col,
  Switch,
  Button,
  ButtonGroup,
  Select,
  Option,
  Icon,
  Input,
  InputNumber,
  Dialog,
  Upload,
  Radio,
  RadioGroup,
  Pagination,
  Loading,
  Message,
  MessageBox,
  Tabs,
  TabPane,
  Table,
  TableColumn,
  Checkbox,
  CheckboxGroup,
  // CheckboxButton,
  // Form,
  // Tabs,
  Popover,
  Tooltip,
  Form,
  FormItem,
  DatePicker,
  Timeline,
  TimelineItem,
  TimeSelect,
  Dropdown,
  DropdownItem,
  DropdownMenu,
  Tag,
  Cascader,
  Tree,
  Card,
  Alert,
  Step,
  Steps,
  Link
  // TimePicker
} from 'element-ui'
import './styles/element-variables.scss'
import CommonInput from './components/CommonInput'
import elTableInfiniteScroll from 'el-table-infinite-scroll';
// import SimpleLineIcons from 'vue-simple-line'

import { library } from '@fortawesome/fontawesome-svg-core'
import { faUser, faHome, faCog, faShoppingCart, faList, faChartPie,faBook } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(faUser)
library.add(faHome)
library.add(faCog)
library.add(faShoppingCart)
library.add(faList)
library.add(faChartPie)
library.add(faBook)

import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)

Vue.use(Row)
Vue.use(TimeSelect)
Vue.use(Col)
Vue.use(ButtonGroup)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
// Vue.use(CheckboxButton)
// Vue.use(Row)
// Vue.use(Col)
Vue.use(Button)
Vue.use(Select)
Vue.use(Option)
Vue.use(Icon)
Vue.use(Input)
Vue.use(InputNumber)
Vue.use(Dialog)
Vue.use(Upload)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Pagination)
Vue.use(Tabs)
Vue.use(Table)
Vue.use(TableColumn)
// Vue.use(Form)

// Vue.use(Tabs)
Vue.use(Popover)
Vue.use(Tooltip)
Vue.use(Form)
Vue.use(Switch)
Vue.use(FormItem)
Vue.use(TabPane)
Vue.use(DatePicker)
Vue.use(TimelineItem)
Vue.use(Timeline)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.use(Tag)
Vue.use(Cascader)
Vue.use(Tree)
Vue.use(Card)
Vue.use(Alert)
Vue.use(Step)
Vue.use(Steps)
Vue.use(Link)
Vue.use(Loading.directive);
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$message = Message;
Vue.component('font-awesome-icon', FontAwesomeIcon)
Vue.component('common-input', CommonInput)
Vue.use(elTableInfiniteScroll);

import components from '@/components/components.js';
Vue.use(components);

import './styles/common.css';
import './styles/fonts/iconfont.css';
import '@/utils/rem'

// register global utility filters.
Object.keys(filters).forEach(key => {
    // console.log(key)
    Vue.filter(key, filters[key])
})
window.$ = window.jQuery = require('jquery');

Vue.config.productionTip = false
import formatDate from './utils/formatDate'

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
